home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_jade.idb / usr / freeware / include / sp / lib / LpdEntityRef.h.z / LpdEntityRef.h
Encoding:
C/C++ Source or Header  |  1999-07-21  |  1021 b   |  47 lines

  1. // Copyright (c) 1994 James Clark
  2. // See the file COPYING for copying permission.
  3.  
  4. #ifndef LpdEntityRef_INCLUDED
  5. #define LpdEntityRef_INCLUDED 1
  6.  
  7. #include "Entity.h"
  8. #include "Boolean.h"
  9. #include "Ptr.h"
  10.  
  11. // Information about a reference to an entity that
  12. // used a definition in an LPD.
  13.  
  14. #ifdef SP_NAMESPACE
  15. namespace SP_NAMESPACE {
  16. #endif
  17.  
  18. struct LpdEntityRef {
  19.   ConstPtr<Entity> entity;
  20.   PackedBoolean lookedAtDefault;
  21.   PackedBoolean foundInPass1Dtd;
  22.   static inline const LpdEntityRef &key(const LpdEntityRef &r) { return r; }
  23.   static inline unsigned long hash(const LpdEntityRef &r) {
  24.     return Hash::hash(r.entity->name());
  25.   }
  26. };
  27.  
  28. inline
  29. Boolean operator==(const LpdEntityRef &r1, const LpdEntityRef &r2)
  30. {
  31.   return (r1.entity == r2.entity
  32.       && r1.foundInPass1Dtd == r2.foundInPass1Dtd
  33.       && r1.lookedAtDefault == r2.lookedAtDefault);
  34. }
  35.  
  36. inline
  37. Boolean operator!=(const LpdEntityRef &r1, const LpdEntityRef &r2)
  38. {
  39.   return !(r1 == r2);
  40. }
  41.  
  42. #ifdef SP_NAMESPACE
  43. }
  44. #endif
  45.  
  46. #endif /* not LpdEntityRef_INCLUDED */
  47.